import {
  IsNotEmpty,
  IsString,
  MinLength,
  MaxLength,
  IsOptional,
  IsDate,
  Min,
  Max,
  ArrayNotEmpty,
  IsInt,
  IsNumber,
  IsPhoneNumber,
} from 'class-validator';
import { ApiErrorCode } from '../../common/enums/api-error-code.enum';
import { plainToClass, Exclude, Type } from 'class-transformer';

export class CreateDto {
  @IsNotEmpty({ message: '请填写商品名称' })
  readonly name: string;

  @Type(() => Number)
  @IsNotEmpty({ message: '请填写商品价格' })
  readonly price: string;

  @IsNotEmpty({ message: '请填写商品详情' })
  readonly infoCode: string;
}

export class PutDto {
  @Type(() => Number)
  @IsNotEmpty({ message: '请填写商品名称' })
  readonly id: string;

  @IsNotEmpty({ message: '请填写商品名称' })
  readonly name: string;

  @Type(() => Number)
  @IsNotEmpty({ message: '请填写商品价格' })
  readonly price: string;

  @IsNotEmpty({ message: '请填写商品详情' })
  readonly infoCode: string;
}
